home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / clang / fgl105c.zip / 10-06.C < prev    next >
Text File  |  1991-05-05  |  861b  |  43 lines

  1. main()
  2. {
  3.    int old_mode;
  4.    int hidden;
  5.    int x;
  6.  
  7.    /* initialize the video environment */
  8.  
  9.    if (fg_testmode(13,3) == 0) {
  10.       printf("This program requires EGA.\n");
  11.       exit();
  12.       }
  13.    old_mode = fg_getmode();
  14.    fg_setmode(13);
  15.  
  16.    /* draw the background on page two */
  17.  
  18.    fg_setpage(2);
  19.    fg_setcolor(1);
  20.    fg_rect(0,319,0,199);
  21.    fg_setcolor(15);
  22.    fg_move(160,100);
  23.    fg_ellipse(20,20);
  24.  
  25.    /* slide the object across the screen */
  26.  
  27.    hidden = 1;
  28.    fg_setcolor(10);
  29.    for (x = -10; x < 320; x+=4) {
  30.       fg_setpage(hidden);
  31.       fg_transfer(0,319,0,199,0,199,2,hidden);
  32.       fg_clprect(x,x+19,96,105);
  33.       fg_setvpage(hidden);
  34.       hidden = 1 - hidden;
  35.       fg_waitfor(1);
  36.       }
  37.  
  38.    /* restore the original video mode and return to DOS */
  39.  
  40.    fg_setmode(old_mode);
  41.    fg_reset();
  42. }
  43.